{% extends 'base_project.html' %}

{% block content %}
{% if form %}
    {% include 'issues/_issue_edit.html' %}
{% else %}
	<h2>Issue: {{ issue }}</h2>
	<ul>
		<li>Created: {{ issue.date_added|timesince }} ago by <a href="{{ issue.creator.get_absolute_url }}">{{ issue.creator }}</a></li>
		<li>Last updated: {{ issue.date_modified|timesince }} ago</li>
		{% if issue.milestone %}<li>Milestone: {{ issue.milestone }}</li>{% endif %}
		{% if issue.date_due %}<li>Date due: {{ issue.date_due|timeuntil }}</li>{% endif %}
		{% if issue.date_completed %}<li>Date completed: {{ issue.date_completed|timeuntil }}</li>{% endif %}
		<li>Status: {{ issue.status }}</li>
	</ul>
    <h3>Description:</h3>
    <p>{{ issue.description }}</p>
    <h3>Owners:</h3>
    {% if issue.owners.all %}
	    <ul>
	    {% for owner in issue.owners.all %}
	        <li><a href="{{ owner.get_absolute_url }}">{{ owner }}</a></li>
	    {% endfor %}
	    </ul>
    {% else %}
        <p>This issue has not yet been assigned.</p>
    {% endif %}
{% endif %}
{% endblock content %}